<!DOCTYPE html>
<html lang="cn">

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="chapter" content="cp">

  <!-- For Facebook Sharing -->
  <meta property="og:url" content="http://students.brown.edu/seeing-theory/compound-probability" />
  <meta property="og:type" content="article" />
  <meta property="og:title" content="进阶概率论" />
  <meta property="og:description" content="本章将进一步介绍概率论中的一些核心知识。" />
  <meta property="og:image" content="http://students.brown.edu/seeing-theory/img/share/2.png" />
  <meta property="og:image:width" content="1200" />
  <meta property="og:image:height" content="630" />

  <title>看见统计 - 进阶概率论</title>
  <!-- CSS Imports -->
   <!-- Fonts -->
   <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
   <link href="https://fonts.font.im/css?family=Assistant:300,400,600,700" rel="stylesheet">
  <!--Favicon-->
  <link rel="shortcut icon" type="image/png" href="../img/favicon.png" />
  <!-- General Chapter -->
  <link rel="stylesheet" type="text/css" href="../css/chapter-style.css">
  <!-- Specific Chapter -->
  <link rel="stylesheet" type="text/css" href="compound-probability.css">
  <!-- JavaScript Imports -->
  <!-- D3 -->
  <script src="../js/d3.min.js"></script>
  <!-- Jquery -->
  <script src="../js/jquery.min.js"></script>
  <script src="../js/jquery-ui.js"></script>
  <!-- jstat -->
  <script src="../js/jstat.min.js"></script>
  <!-- MathJax -->
  <script type="text/javascript" async
    src="https://cdnjs.loli.net/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS_HTML"></script>
  <!-- Tool Tip -->
  <script src="../js/d3.tip.v0.6.3.js"></script>
  <!-- General Chapter -->
  <script src="../js/chapter.js"></script>
  <!-- Visualizations -->
  <script src="compound-probability.js"></script>
  <!-- Google Analytics -->
  <script>
    (function(i, s, o, g, r, a, m) {
      i['GoogleAnalyticsObject'] = r;
      i[r] = i[r] || function() {
        (i[r].q = i[r].q || []).push(arguments)
      }, i[r].l = 1 * new Date();
      a = s.createElement(o),
        m = s.getElementsByTagName(o)[0];
      a.async = 1;
      a.src = g;
      m.parentNode.insertBefore(a, m)
    })(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');
    ga('create', 'UA-85617614-1', 'auto');
    ga('send', 'pageview');
  </script>
</head>

<body id='2'>
  <div id="share-modal"></div>
  <div class="header">
    <div class="progress-bar">
      <div class="progress-bar-color"></div>
    </div>
    <div class="header-wrapper">
      <ul class="chapter-nav">
        <li>
          <span onclick="openNav()" id="hamburger">&#9776; </span>
        </li>
        <li><a href="../cn.html" id="seeing-theory">看见统计</a></li>
        <li><a onclick='toTop()' id='display-chapter'>第二章: 进阶概率论</a></li>
      </ul>
    </div>
  </div>
  <div class="col-left">
    <div class="col-left-wrapper">
      <div id="section0">
        <div class="chapter-intro">
          <h4>第二章</h4>
          <h1>进阶概率论</h1>
          <p>本章将进一步介绍概率论中的一些核心知识。
          </p>
        </div>
        <div class="scroll-down"> <img src="../img/button/bottom-arrow.svg"></div>
      </div>
      <div id="section1">
        <div class="unit">
          <h3>集合论</h3>
          <p>
            广而言之，一个集合指的是一些物体的总体。在概率论中，我们用一个集合来表示一些事件的组合。比如，我们可以用集合{2，4，6}来表示“投骰子投出偶数”这个事件。因此我们有必要掌握一些基本的集合的运算。</br></br>用下面的集合生成器来构造一个集合，然后点击“提交”来查看你的集合对应的文氏图。通过拖放来移动或者放缩圆的大小。
          </p>
          <div class="interactive-wrapper">
            <div id="setCalc">
              <div class="button-1-s setItem" title="A set">A</div>
              <div class="button-1-s setItem" title="B set">B</div>
              <div class="button-1-s setItem" title="C set">C</div>
              <div class="button-1-s setItem" title="empty set">&empty;</div>
              <div class="button-1-s setItem" title="universal set">U</div>
              </br>
              <div class="button-1-s setItem" title="open parentheses">(</div>
              <div class="button-1-s setItem" title="intersection">&cap;</div>
              <div class="button-1-s setItem" title="union">&cup;</div>
              <div class="button-1-s setItem" title="complement">'</div>
              <div class="button-1-s setItem" title="close parentheses">)</div>
              <div class="form-control text-box" id="set"></div>
              <div class="button-1" id="submit">提交</div>
              <div class="button-1" id="delete">删除</div>
              <div class="button-1" id="reset">重置</div>
            </div>
          </div>
          <p class='text-center' id='invalidSet'></p>
          <p>*用以上的可视化工具来验证这些等式：<a href='https://cs.brown.edu/courses/cs022/static/files/documents/sets.pdf'>集合等式</a>.
          </p>
        </div>
      </div>
      <div id="section2">
        <div class="unit">
          <h3>古典概型</h3>
          <p>
            古典概型本质上就是数数。但是在概率论中，数数有时候比想象中要困难的多。因为我们有时要数清楚符合一些性质的事件或者轨道个数的，而这些性质往往比较复杂，因此数数的任务也变得困难起来。假设我们有一袋珠子，每个珠子的颜色都不相同。如果我们无放回地从袋子里抽取珠子，一共有多少种可能出现的颜色序列（排列）呢？有多少种可能出现的没有顺序的序列（组合）呢？
          </p>
          <div class="interactive-wrapper">
            <label class="radio-inline">P排列
              <input type="radio" name="radioComb" checked="checked" value=false>
              <span class="checkmark"></span>
            </label>
            <label class="radio-inline">组合
              <input type="radio" name="radioComb" value=true>
              <span class="checkmark"></span>
            </label>
          </div>
          <p> 选择袋子中珠子的数量：</p>
          <div class="interactive-wrapper">
            <div id="sizeComb">
              <img class="button-1" src="./img/marble1.svg">
              <img class="button-1" src="./img/marble2.svg">
              <img class="button-1" src="./img/marble3.svg">
              <img class="button-1 active" src="./img/marble4.svg">
            </div>
          </div>
          <p> 点击下面的表格来查看所有可能出现的排列和组合。</p>

          <table id="count_table" style="cursor:pointer" class="table table-bordered">
            <colgroup></colgroup>
            <colgroup></colgroup>
            <colgroup></colgroup>
            <colgroup></colgroup>
            <colgroup></colgroup>
            <colgroup class="click"></colgroup>
            <tbody>
              <tr>
                <td>\(\displaystyle{n}\)</td>
                <td>0</td>
                <td>1</td>
                <td>2</td>
                <td>3</td>
                <td>4</td>
              </tr>
              <tr>
                <td>
                  <span class="count_label"> \(\displaystyle{P_{n,r}}\)</span>
                  <span class="count_label" style="display: none">\(\displaystyle{C_{n,r}}\)</span>
                </td>
                <td id="r0">1</td>
                <td id="r1"></td>
                <td id="r2"></td>
                <td id="r3"></td>
                <td id="r4"></td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
      <div id="section3">
        <div class="unit">
          <h3>条件概率</h3>
          <p>条件概率让我们可以利用已有的信息。举个例子，在<em>今天多云</em> 的情况下，我们会估计“明天下雨”的概率小于“今天下雨”。这种基于已有的相关信息得出的概率称为条件概率。
          </p>
          <p>
            数学上，条件概率的计算一般会把的样本空间缩小到一个我们已知信息的事件。再以之前举的下雨为例，我们现在只考虑所有前一天多云的日子，而不是考虑所有的日子。然后我们确定在这些天中有多少天下雨，这些下雨天数在所有我们考虑的天数中的比例即为条件概率。
          </p>
          <p>点击下面的标签来观察不同的样本空间图形。</p>
          <div class="interactive-wrapper">
            <div id="perspectiveControl">
              </br>
              <div class="button-1 perspective" id="a">A</div>
              <div class="button-1 perspective" id="b">B</div>
              <div class="button-1 perspective" id="c">C</div>
              <div class="button-1 perspective active" id="universe">全局</div>
            </div>
            <div id='svgProbCP'></div>
          </div>
          <p>图形展示改编自Victor Powell: <a href="http://setosa.io/conditional/">条件概率</a>
        </div>
      </div>
    </div>
    <div class="action-buttons">
      <ul>
        <a href="../doc/compound-probability.pdf">
          <li><i class="fa fa-file-text-o action-icon" aria-hidden="true"></i> <span>英文PDF下载</span></li>
        </a>
        <a id="share-button" class="inline-share">

          <li><i class="fa fa-share-square-o action-icon" aria-hidden="true"></i>分享</li>
          <li>
            <div id="share" data-sites="weibo,qq,douban,wechat, facebook, twitter, google,linkedin"></div>
          </li>
          <li>
            <div id="share-modal"></div>
          </li>

        </a>
      </ul>
    </div>
    <a href="../probability-distributions/cn.html">
      <div class="chapter-footer" id="next-chapter-color">
        <div class="chapter-footer-wrapper">
          <h4>下一章</h4>
          <p id='next-chapter'>概率分布 → </p>
        </div>
      </div>
    </a>
  </div>
  <div class="col-right">
    <div class='language-setting'>
      <select class="languageSetting">
        <option selected>中文</option>
        <option data-url="index.html">English</option>
        <option data-url="es.html">Español</option>
      </select>
    </div>
    <div class="nav-section" id="section-0">
      <div class="nav-unit-wrapper" id='one'>
        <img src="../img/tiles/2-1.png">
        <span class="nav-unit-title"> 集合论 </span>
      </div>
      <div class="nav-unit-wrapper" id='two'>
        <img src="../img/tiles/2-2.png">
        <span class="nav-unit-title"> 古典概型 </span>
      </div>
      <div class="nav-unit-wrapper" id='three'>
        <img src="../img/tiles/2-3.png">
        <span class="nav-unit-title"> 条件概率 </span>
      </div>
    </div>
    <div class="visualization-section" id="section-1">
      <div class="visualization-wrapper" id="svgSet"></div>
    </div>
    <div class="visualization-section" id="section-2">
      <div class="visualization-wrapper" id="svgComb"></div>
    </div>
    <div class="visualization-section" id="section-3">
      <div class="visualization-wrapper" id="svgBallCP"></div>
    </div>
  </div>
  <div id="overlay">
    <div class="modal-header">
      <div class="closebtn" onclick="closeNav()">&times;</div>
      <ul>
        <li>
          <select class="languageSetting">
            <option selected>中文</option>
            <option data-url="index.html">English</option>
            <option data-url="es.html">Español</option>
          </select>
        </li>
        <li><a href="../index.html">首页</a></li>
      </ul>
    </div>
    <div class="modal-wrapper">
      <div class="modal-chapter">
        <div id="chapter-text"><span>章节</span></div>
        <ul class="modal-chapter-titles">
          <li id="bp-li">基础概率论</li>
          <li id="cp-li" class="chapter-highlighted">进阶概率论</li>
          <li id="pd-li">概率分布</li>
          <li id="fi-li">统计推断：频率学派</li>
          <li id="bi-li">统计推断：贝叶斯学派</li>
          <li id="ra-li">回归分析</li>
        </ul>
      </div>
      <div class="modal-visualization">
        <div id="bp">
          <div class="nav-unit-wrapper-s tile1">
            <img src="../img/tiles/1-1.png" class="nav-unit-tile-s">
            <span class="nav-unit-title-s"> 随机事件 </span>
          </div>
          <div class="nav-unit-wrapper-s tile2">
            <img src="../img/tiles/1-2.png" class="nav-unit-tile-s">
            <span class="nav-unit-title-s"> 期望 </span>
          </div>
          <div class="nav-unit-wrapper-s tile3">
            <img src="../img/tiles/1-3.png" class="nav-unit-tile-s">
            <span class="nav-unit-title-s"> 方差 </span>
          </div>
        </div>
        <div id="cp" class="current">
          <div class="nav-unit-wrapper-s tile1">
            <img src="../img/tiles/2-1.png" class="nav-unit-tile-s">
            <span class="nav-unit-title-s"> 集合论 </span>
          </div>
          <div class="nav-unit-wrapper-s tile2">
            <img src="../img/tiles/2-2.png" class="nav-unit-tile-s">
            <span class="nav-unit-title-s"> 古典概型 </span>
          </div>
          <div class="nav-unit-wrapper-s tile3">
            <img src="../img/tiles/2-3.png" class="nav-unit-tile-s">
            <span class="nav-unit-title-s"> 条件概率 </span>
          </div>
        </div>
        <div id="pd">
          <div class="nav-unit-wrapper-s tile1">
            <img src="../img/tiles/3-1.png" class="nav-unit-tile-s">
            <span class="nav-unit-title-s"> 随机变量 </span>
          </div>
          <div class="nav-unit-wrapper-s tile2">
            <img src="../img/tiles/3-2.png" class="nav-unit-tile-s">
            <span class="nav-unit-title-s"> 离散型和连续型随机变量 </span>
          </div>
          <div class="nav-unit-wrapper-s tile3">
            <img src="../img/tiles/3-3.png" class="nav-unit-tile-s">
            <span class="nav-unit-title-s"> 中心极限定理 </span>
          </div>
        </div>
        <div id="fi">
          <div class="nav-unit-wrapper-s tile1">
            <img src="../img/tiles/4-1.png" class="nav-unit-tile-s">
            <span class="nav-unit-title-s"> 点估计理论 </span>
          </div>
          <div class="nav-unit-wrapper-s tile2">
            <img src="../img/tiles/4-2.png" class="nav-unit-tile-s">
            <span class="nav-unit-title-s"> 置信区间 </span>
          </div>
          <div class="nav-unit-wrapper-s tile3">
            <img src="../img/tiles/4-3.png" class="nav-unit-tile-s">
            <span class="nav-unit-title-s"> Bootstrap方法 </span>
          </div>
        </div>
        <div id="bi">
          <div class="nav-unit-wrapper-s tile1">
            <img src="../img/tiles/5-1.png" class="nav-unit-tile-s">
            <span class="nav-unit-title-s"> 贝叶斯公式 </span>
          </div>
          <div class="nav-unit-wrapper-s tile2">
            <img src="../img/tiles/5-2.png" class="nav-unit-tile-s">
            <span class="nav-unit-title-s"> 似然函数 </span>
          </div>
          <div class="nav-unit-wrapper-s tile3">
            <img src="../img/tiles/5-3.png" class="nav-unit-tile-s">
            <span class="nav-unit-title-s"> 从先验概率到后验概率 </span>
          </div>
        </div>
        <div id="ra">
          <div class="nav-unit-wrapper-s tile1">
            <img src="../img/tiles/6-1.png" class="nav-unit-tile-s">
            <span class="nav-unit-title-s"> 最小二乘法 </span>
          </div>
          <div class="nav-unit-wrapper-s tile2">
            <img src="../img/tiles/6-2.png" class="nav-unit-tile-s">
            <span class="nav-unit-title-s"> 相关性 </span>
          </div>
          <div class="nav-unit-wrapper-s tile3">
            <img src="../img/tiles/6-3.png" class="nav-unit-tile-s">
            <span class="nav-unit-title-s"> 方差分析 </span>
          </div>
        </div>
      </div>
    </div>
  </div>
  <!-- Share CSS and JavaScript -->

  <link rel="stylesheet" href="../css/share.min.css">
  <script src="../js/jquery.share.min.js"></script>
  <script>
    $('#share').share();

    $(".languageSetting").change(function() {
      var option = $(this).find('option:selected');
      window.location.href = option.data("url");
    });

  </script>
</body>

</html>
